package com.net.xpay.common.service;

import com.net.xpay.common.domain.User;
import com.net.xpay.common.domain.partner.PartnerWithdrawRecord;
import com.net.xpay.common.domain.partner.PartnerWithdrawRecordBatch;
import com.net.xpay.core.domain.safePay.SafePayBatch;

/**
 * 2020/9/4 19:12

 */
public interface PartnerWithdrawService {

    /**
     * 生成合伙人批次
     */
    void createPartnerWithdrawBatch();

    /**
     * 生成单个合伙人的提现记录
     * @param partnerId 合伙人id
     * @param transferMoney 转账金额
     * @return 提现记录
     */
    PartnerWithdrawRecord createPartnerWithdrawRecord(Long partnerId, Long transferMoney, String alipayName, String alipayAccount);

    /**
     * 安全发打款提现
     * @param id PartnerWithdrawBatch.id
     * @param alipayAccount 转账付款支付宝
     */
    void transPartnerWithdrawBatch(Long id, User transUser, String alipayAccount);

    /**
     * 跟新安全付打款结果
     * @param user 打款用户
     * @param safePayBatch 提现批次
     */
    void updatePartnerWithdrawBatchResultBySafePay(User user, SafePayBatch safePayBatch);

    /**
     * 跟新打款结果
     * @param batch 提现批次
     * @param transUser 打款用户
     */
    void updatePartnerWithdrawBatchResult(PartnerWithdrawRecordBatch batch, User transUser);

    /**
     * 取消提现
     * @param id
     */
    void cancelWithdrawRecord(Long id, String remark);

    /**
     * 线下转账
     * @param id
     */
    void ensurePartnerWithdrawBatch(Long id);
}
